﻿<UserControl x:Class="DraggableWindow.Page"
             xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
             xmlns="http://schemas.microsoft.com/client/2007" 
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             xmlns:controls="clr-namespace:DraggableWindow;assembly=PopupControls">
    <Grid x:Name="LayoutRoot" Background="White">       
     
        <StackPanel Orientation="Vertical">
            <Button Margin="5 5 5 5" Height="26" Width="200" Content="New Window" x:Name="btnNew" Click="btnNew_Click" />
            <Button Margin="5 5 5 5" Height="26" Width="200" Content="New Modal Window"  Click="Button_Click" />
            <Button Margin="5 5 5 5" Height="26" Width="200" Content="Clear" x:Name="btnClear" Click="btnClear_Click" />
            <Button Margin="5 5 5 5" Height="26" Width="200" Content="Restore" x:Name="btnRestore" Click="btnRestore_Click" />
        </StackPanel>
     
        <controls:DragDropControl OffsetX="10" OffsetY="10" >
            <Border BorderThickness="1" BorderBrush="#ccc" >
                <StackPanel Orientation="Vertical" Background="AntiqueWhite">
                    <TextBlock Text="You can drag me around"></TextBlock>
                    <TextBlock Text="You can put any content here!!!" ></TextBlock>
                </StackPanel>
            </Border>
        </controls:DragDropControl>
        
        <controls:DragDropControl CanResize="True" OffsetX="100" OffsetY="50" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" >
                <Border VerticalAlignment="Stretch" HorizontalAlignment="Stretch"  BorderThickness="1" BorderBrush="#ccc">
                    <StackPanel Orientation="Vertical" Background="AliceBlue">                    
                        <TextBlock Text="You can drag me around (I stretch)"></TextBlock>
                        <TextBlock Text="You can put any content here" ></TextBlock>
                        <TextBlock Text="I'm resizable"></TextBlock>
                    </StackPanel>
              </Border>
         </controls:DragDropControl>

        <controls:DragDropControl CanResize="True"
                                 HorizontalAlignment="Center" >
            <Border BorderThickness="1"
                    BorderBrush="#ccc">
                <StackPanel Orientation="Vertical"
                            Background="AliceBlue">
                    <TextBlock Text="You can drag me around, i'm in the center"></TextBlock>
                    <TextBlock Text="You can put any content here"></TextBlock>
                    <TextBlock Text="I'm resizable"></TextBlock>
                </StackPanel>
            </Border>
        </controls:DragDropControl>

        <controls:PopupWindow
            StatusVisibility="Visible"
            CanResize="True" Title="Window" OffsetX="100" OffsetY="100" Status="window status here" >                   
                <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                </Grid.RowDefinitions>
                <TextBox Text="Enter Text Here" Margin="2" />
                <TextBlock Text="You can drag me around" Margin="2"  Grid.Row="1"></TextBlock>
                <TextBlock Text="You can put any content here" Margin="2"  Grid.Row="2"></TextBlock>
                <TextBlock Text="I'm resizable" Grid.Row="3" Margin="2"  ></TextBlock>
                <TextBlock Text="I have a status bar" Grid.Row="4" Margin="2"  ></TextBlock>
            </Grid>         
         </controls:PopupWindow>
            
        <controls:PopupWindow CanResize="False" Title="Window" Width="300" Height="300" OffsetX="100" OffsetY="200"  >
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"></RowDefinition>
                    <RowDefinition Height="*"></RowDefinition>                   
                </Grid.RowDefinitions>
                    <TextBlock Text="You can drag me around" Grid.Row="0"></TextBlock>
                    <TextBlock Text="You can put any content here" Grid.Row="1"></TextBlock>
                </Grid>
        </controls:PopupWindow>
        
    </Grid>      
</UserControl>
